package com.java.zhuiyun.api.propmgt.controller;

import com.java.zhuiyun.api.propmgt.service.PropMgtService;
import com.java.zhuiyun.common.response.CommonConstants;
import com.java.zhuiyun.common.response.CommonResult;
import com.java.zhuiyun.config.AuthAccess;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName AppPropController
 * @Description TODO
 * @Author 杨友朋
 * @Date 2023/9/26 16:59
 **/
@RestController
@RequestMapping("/appProp")
public class AppPropController {
    @Autowired
    private PropMgtService propMgtService;
    /**
     * @Author 杨友朋
     * @Description TODO app用户查询道具数量
     * @Date 2023/9/26 16:54
     * @Return
     * @param
     */
    @GetMapping("/userSelectProp")
    @AuthAccess
    @ApiOperation(value = "app用户查询道具数量")
    public CommonResult userSelectProp(Integer userId){
        return CommonResult.ok(propMgtService.userSelectProp(userId));
    }

    /**
    * @Author 杨友朋
    * @Description TODO 使用道具
    * @Date 2023/10/16 14:12
    * @Return CommonResult
    * @param userId,propId
    */
    @GetMapping("/userUseProp")
    @AuthAccess
    @ApiOperation(value = "app用户查询道具数量")
    public CommonResult userUseProp(Integer userId, Integer propId){
        return propMgtService.userUseProp(userId,propId);
    }

    @GetMapping("/userAddProp")
    @AuthAccess
    @ApiOperation(value = "app用户查询道具数量")
    public CommonResult userAddProp(Integer userId, Integer propId){
        return propMgtService.userAddProp(userId,propId);
    }
}
